<template>
    <div>
        <Table ref="dataTable" stripe :loading="table.loading" :columns="table.tableColumns" :data="table.tableRows"
               style="margin-top:20px;" @on-selection-change="changeSelection" @on-sort-change="changeSort"></Table>
        <div style="margin: 20px; overflow: hidden">
            <div style="float: right;">
                <Page :total="pager.total" :current="pager.pageNo" @on-change="changePageNo" @on-page-size-change="changePageSize"
                      showSizer showTotal></Page>
            </div>
        </div>
    </div>
</template>

<script>
    import * as utils from '@/api/utils-v2'

    export default {
        name: 'UserWithdrawCheckTable',
        data() {
            return {
                urls: {
                    searchUrl: '/user-withdraw-check/admin/pager-cond'
                },
                pager: {
                    pageNo: 1,
                    pageSize: 10,
                    total: 0
                },
                searchOpts: {
                    sortColumn: null,
                    sortOrder: null,
                },
                table: {
                    loading: false,
                    tableColumns: [{
                        type: 'selection',
                        width: 52,
                        key: 'id',
                        align: 'center',
                        fixed: 'left'
                    },
                        {
                            width: 60,
                            align: 'center',
                            fixed: 'left',
                            render: (h, params) => {
                                return h('span', params.index + (this.pager.pageNo - 1) * this.pager.pageSize + 1)
                            }
                        },
                        {
title: '用户编号',
key: 'userId',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.userId) 
}
},
{
title: '手机号',
key: 'userPhone',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.userPhone) 
}
},
{
title: '用户邮箱',
key: 'userEmail',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.userEmail) 
}
},
{
title: '提现编号',
key: 'fundsWithdrawId',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawId) 
}
},
{
title: '交易编号',
key: 'fundsWithdrawTransactionNo',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawTransactionNo) 
}
},
{
title: '提现方式',
key: 'fundsWithdrawWithdrawType',
minWidth: 120,
sortable: true,
renderHeader: (h, params) => {
              return h('span', [
                h('span', '提现方式'),
                h('Tooltip', {
                  props: {
                    content: '如提现到银行卡，提现到微信钱包，提现到支付宝钱包',
                    placement: 'top',
                    transfer: true,
                    maxWidth: 500
                  }
                }, [
                  h('Icon', {
                    props: {
                      type: 'ios-help-circle'
                    },
                    style: {
                      marginLeft: '3px'
                    }
                  })
                ])
              ])
            },
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawWithdrawType) 
}
},
{
title: '发起提现的应用',
key: 'fundsWithdrawWithdrawClientApp',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawWithdrawClientApp) 
}
},
{
title: '提现金额（元）',
key: 'fundsWithdrawAmount',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawAmount) 
}
},
{
title: '提现状态',
key: 'fundsWithdrawWithdrawStatus',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawWithdrawStatus) 
}
},
{
title: '提现描述',
key: 'fundsWithdrawWithdrawDescription',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawWithdrawDescription) 
}
},
{
title: '审核人编号',
key: 'fundsWithdrawCheckedUserId',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawCheckedUserId) 
}
},
{
title: '审核时间',
key: 'fundsWithdrawCheckedTime',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawCheckedTime) 
}
},
{
title: '完成时间',
key: 'fundsWithdrawCompleteTime',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawCompleteTime) 
}
},
{
title: '版本号',
key: 'fundsWithdrawVersion',
minWidth: 120,
sortable: true,
renderHeader: (h, params) => {
              return h('span', [
                h('span', '版本号'),
                h('Tooltip', {
                  props: {
                    content: '提现版本号',
                    placement: 'top',
                    transfer: true,
                    maxWidth: 500
                  }
                }, [
                  h('Icon', {
                    props: {
                      type: 'ios-help-circle'
                    },
                    style: {
                      marginLeft: '3px'
                    }
                  })
                ])
              ])
            },
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawVersion) 
}
},
{
title: '创建时间',
key: 'fundsWithdrawCreateTime',
minWidth: 120,
sortable: true,
renderHeader: (h, params) => {
              return h('span', [
                h('span', '创建时间'),
                h('Tooltip', {
                  props: {
                    content: '提现创建时间',
                    placement: 'top',
                    transfer: true,
                    maxWidth: 500
                  }
                }, [
                  h('Icon', {
                    props: {
                      type: 'ios-help-circle'
                    },
                    style: {
                      marginLeft: '3px'
                    }
                  })
                ])
              ])
            },
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawCreateTime) 
}
},
{
title: '更新时间',
key: 'fundsWithdrawUpdateTime',
minWidth: 120,
sortable: true,
renderHeader: (h, params) => {
              return h('span', [
                h('span', '更新时间'),
                h('Tooltip', {
                  props: {
                    content: '提现更新时间',
                    placement: 'top',
                    transfer: true,
                    maxWidth: 500
                  }
                }, [
                  h('Icon', {
                    props: {
                      type: 'ios-help-circle'
                    },
                    style: {
                      marginLeft: '3px'
                    }
                  })
                ])
              ])
            },
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawUpdateTime) 
}
},
{
title: '是否激活',
key: 'fundsWithdrawIsActive',
minWidth: 120,
sortable: true,
renderHeader: (h, params) => {
              return h('span', [
                h('span', '是否激活'),
                h('Tooltip', {
                  props: {
                    content: '提现是否激活',
                    placement: 'top',
                    transfer: true,
                    maxWidth: 500
                  }
                }, [
                  h('Icon', {
                    props: {
                      type: 'ios-help-circle'
                    },
                    style: {
                      marginLeft: '3px'
                    }
                  })
                ])
              ])
            },
render: (h, params) => {
 return h('span',{}, params.row.fundsWithdrawIsActive) 
}
},
{
title: '银行卡编号',
key: 'userBankcardId',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.userBankcardId) 
}
},
{
title: '持卡人姓名',
key: 'userBankcardAccountName',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.userBankcardAccountName) 
}
},
{
title: '银行代码',
key: 'userBankcardBankCode',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.userBankcardBankCode) 
}
},
{
title: '银行名称',
key: 'userBankcardBankName',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.userBankcardBankName) 
}
},
{
title: '银行卡号',
key: 'userBankcardBankcardNo',
minWidth: 120,
sortable: true,
render: (h, params) => {
 return h('span',{}, params.row.userBankcardBankcardNo) 
}
},

                        {
                            title: '操作',
                            key: 'action',
                            width: 80,
                            align: 'center',
                            fixed: 'right',
                            render: (h, params) => {
                                return h('div', [
                                    h('Button', {
                                        props: {
                                            type: 'primary',
                                            size: 'small'
                                        },
                                        style: {
                                            marginRight: '5px'
                                        },
                                        on: {
                                            click: () => {
                                                this.showDetail(params.row)
                                            }
                                        }
                                    }, '详情')
                                ])
                            }
                        }
                    ],
                    tableRows: [],
                    selections: []
                }
            }
        },
        computed: {},
        mounted() {
            this.search()
        },
        methods: {
            search() {
                this.$emit('searchTable')
            },
            showDetail(row) {
                this.$emit('showDetailModal', JSON.parse(JSON.stringify(row)))
            },
            changeSelection(selections) {
                utils.changeSelections(this, selections)
            },
            changeSort(sortColumn) {
                utils.changeSort(this, sortColumn)
            },
            changePageNo(pageNo) {
                utils.changePageNo(this, pageNo)
            },
            changePageSize(pageSize) {
                utils.changePageSize(this, pageSize)
            }
        }
    }
</script>

<style>
</style>
